package com.ssm.springboot.controller;

import com.ssm.springboot.pojo.DataInfo;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class ExController {

    @ExceptionHandler(value = AuthorizationException.class)
    public String err(){
        return "抱歉,您没有该权限,请联系管理员";
    }

    @ExceptionHandler(value = AuthenticationException.class)
    public String log(){
        return "用户未登录,请登录";
    }
}
